'\" t
.\"     Title: IPSEC.CONF
.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\"      Date: 01/12/2021
.\"    Manual: [FIXME: manual]
.\"    Source: [FIXME: source]
.\"  Language: English
.\"
.TH "IPSEC\&.CONF" "5" "01/12/2021" "[FIXME: source]" "[FIXME: manual]"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ipsec.conf \- IPsec configuration and connections
.SH "DESCRIPTION"
.PP
The optional
\fIipsec\&.conf\fR
file specifies most configuration and control information for the Openswan IPsec subsystem\&. (The major exception is secrets for authentication; see
\fBipsec.secrets\fR(5)\&.) Its contents are not security\-sensitive
\fIunless\fR
manual keying is being done for more than just testing, in which case the encryption/authentication keys in the descriptions for the manually\-keyed connections are very sensitive (and those connection descriptions are probably best kept in a separate file, via the include facility described below)\&.
.PP
The file is a text file, consisting of one or more
\fIsections\fR\&. White space followed by
\fB#\fR
followed by anything to the end of the line is a comment and is ignored, as are empty lines which are not within a section\&.
.PP
A line which contains
\fBinclude\fR
and a file name, separated by white space, is replaced by the contents of that file, preceded and followed by empty lines\&. If the file name is not a full pathname, it is considered to be relative to the directory containing the including file\&. Such inclusions can be nested\&. Only a single filename may be supplied, and it may not contain white space, but it may include shell wildcards (see
\fBsh\fR(1)); for example:
.PP
\fBinclude\fR
\fBipsec\&.*\&.conf\fR
.PP
The intention of the include facility is mostly to permit keeping information on connections, or sets of connections, separate from the main configuration file\&. This permits such connection descriptions to be changed, copied to the other security gateways involved, etc\&., without having to constantly extract them from the configuration file and then insert them back into it\&. Note also the
\fBalso\fR
and
\fBalsoflip\fR
parameters (described below) which permit splitting a single logical section (e\&.g\&. a connection description) into several actual sections\&.
.PP
The first significant line of the file must specify the version of this specification that it conforms to:
.PP
\fBversion 2\fR
.PP
A section begins with a line of the form:
.PP
\fItype\fR
\fIname\fR
.PP
where
\fItype\fR
indicates what type of section follows, and
\fIname\fR
is an arbitrary name which distinguishes the section from others of the same type\&. (Names must start with a letter and may contain only letters, digits, periods, underscores, and hyphens\&.) All subsequent non\-empty lines which begin with white space are part of the section; comments within a section must begin with white space too\&. There may be only one section of a given type with a given name\&.
.PP
Lines within the section are generally of the form
.PP
\ \&\ \&\ \&\ \&\ \&\fIparameter\fR\fB=\fR\fIvalue\fR
.PP
(note the mandatory preceding white space)\&. There can be white space on either side of the
\fB=\fR\&. Parameter names follow the same syntax as section names, and are specific to a section type\&. Unless otherwise explicitly specified, no parameter name may appear more than once in a section\&.
.PP
An empty
\fIvalue\fR
stands for the system default value (if any) of the parameter, i\&.e\&. it is roughly equivalent to omitting the parameter line entirely\&. A
\fIvalue\fR
may contain white space only if the entire
\fIvalue\fR
is enclosed in double quotes (\fB"\fR); a
\fIvalue\fR
cannot itself contain a double quote, nor may it be continued across more than one line\&.
.PP
Numeric values are specified to be either an \(lqinteger\(rq (a sequence of digits) or a \(lqdecimal number\(rq (sequence of digits optionally followed by `\&.\*(Aq and another sequence of digits)\&.
.PP
There is currently one parameter which is available in any type of section:
.PP
\fBalso\fR
.RS 4
the value is a section name; the parameters of that section are appended to this section, as if they had been written as part of it\&. The specified section must exist, must follow the current one, and must have the same section type\&. (Nesting is permitted, and there may be more than one
\fBalso\fR
in a single section, although it is forbidden to append the same section more than once\&.) This allows, for example, keeping the encryption keys for a connection in a separate file from the rest of the description, by using both an
\fBalso\fR
parameter and an
\fBinclude\fR
line\&. (Caution, see BUGS below for some restrictions\&.)
.RE
.PP
\fBalsoflip\fR
.RS 4
can be used in a
\fBconn\fR
section\&. It acts like an
\fBalso\fR
that flips the referenced section\*(Aqs entries left\-for\-right\&.
.RE
.PP
Parameter names beginning with
\fBx\-\fR
(or
\fBX\-\fR, or
\fBx_\fR, or
\fBX_\fR) are reserved for user extensions and will never be assigned meanings by IPsec\&. Parameters with such names must still observe the syntax rules (limits on characters used in the name; no white space in a non\-quoted value; no newlines or double quotes within the value)\&. All other as\-yet\-unused parameter names are reserved for future IPsec improvements\&.
.PP
A section with name
\fB%default\fR
specifies defaults for sections of the same type\&. For each parameter in it, any section of that type which does not have a parameter of the same name gets a copy of the one from the
\fB%default\fR
section\&. There may be multiple
\fB%default\fR
sections of a given type, but only one default may be supplied for any specific parameter name, and all
\fB%default\fR
sections of a given type must precede all non\-\fB%default\fR
sections of that type\&.
\fB%default\fR
sections may not contain
\fBalso\fR
or
\fBalsoflip\fR
parameters\&.
.PP
Currently there are two types of section: a
\fBconfig\fR
section specifies general configuration information for IPsec, while a
\fBconn\fR
section specifies an IPsec connection\&.
.SH "CONN SECTIONS"
.PP
A
\fBconn\fR
section contains a
\fIconnection specification\fR, defining a network connection to be made using IPsec\&. The name given is arbitrary, and is used to identify the connection to
\fBipsec_auto\fR(8)
and
\fBipsec_manual\fR(8)\&. Here\*(Aqs a simple example:
.sp
.if n \{\
.RS 4
.\}
.nf

\fB
conn snt
	left=10\&.11\&.11\&.1
	leftsubnet=10\&.0\&.1\&.0/24
	leftnexthop=172\&.16\&.55\&.66
	leftsourceip=10\&.0\&.1\&.1
	right=192\&.168\&.22\&.1
	rightsubnet=10\&.0\&.2\&.0/24
	rightnexthop=172\&.16\&.88\&.99
	rightsourceip=10\&.0\&.2\&.1
	keyingtries=%forever
\fR
.fi
.if n \{\
.RE
.\}
.PP
A note on terminology\&.\&.\&. In automatic keying, there are two kinds of communications going on: transmission of user IP packets, and gateway\-to\-gateway negotiations for keying, rekeying, and general control\&. The data path (a set of \(lqIPsec SAs\(rq) used for user packets is herein referred to as the \(lqconnection\(rq; the path used for negotiations (built with \(lqISAKMP SAs\(rq) is referred to as the \(lqkeying channel\(rq\&.
.PP
To avoid trivial editing of the configuration file to suit it to each system involved in a connection, connection specifications are written in terms of
\fIleft\fR
and
\fIright\fR
participants, rather than in terms of local and remote\&. Which participant is considered
\fIleft\fR
or
\fIright\fR
is arbitrary; IPsec figures out which one it is being run on based on internal information\&. This permits using identical connection specifications on both ends\&. There are cases where there is no symmetry; a good convention is to use
\fIleft\fR
for the local side and
\fIright\fR
for the remote side (the first letters are a good mnemonic)\&.
.PP
Many of the parameters relate to one participant or the other; only the ones for
\fIleft\fR
are listed here, but every parameter whose name begins with
\fBleft\fR
has a
\fBright\fR
counterpart, whose description is the same but with
\fBleft\fR
and
\fBright\fR
reversed\&.
.PP
Parameters are optional unless marked \(lq(required)\(rq; a parameter required for manual keying need not be included for a connection which will use only automatic keying, and vice versa\&.
.SS "CONN PARAMETERS: GENERAL"
.PP
The following parameters are relevant to both automatic and manual keying\&. Unless otherwise noted, for a connection to work, in general it is necessary for the two ends to agree exactly on the values of these parameters\&.
.PP
\fBconnaddrfamily\fR
.RS 4
the connection addrress family of the connection; currently the accepted values are
\fBipv4\fR
(the default); or
\fBipv6\fR\&. This option is confusing, especially when doing IPv4\-in\-IPv6 or IPv6\-in\-IPv4 tunnels\&. The developers hope to remove this option in the near future for proper auto\-detection\&. For now, set connaddrfamily= to the family of the *subnet= options, and if those are not defined, to the family of the left=/right= options\&.
.sp
IPv6 is supported with NETKEY since openswan 2\&.4 and with KLIPS since Openswan 2\&.6\&.33
.RE
.PP
\fBtype\fR
.RS 4
the type of the connection; currently the accepted values are
\fBtunnel\fR
(the default) signifying a host\-to\-host, host\-to\-subnet, or subnet\-to\-subnet tunnel;
\fBtransport\fR, signifying host\-to\-host transport mode;
\fBpassthrough\fR, signifying that no IPsec processing should be done at all;
\fBdrop\fR, signifying that packets should be discarded; and
\fBreject\fR, signifying that packets should be discarded and a diagnostic ICMP returned\&.
.RE
.PP
\fBleft\fR
.RS 4
(required) the IP address of the left participant\*(Aqs public\-network interface, in any form accepted by
\fBipsec_ttoaddr\fR(3)\&. Currently, IPv4 and IPv6 IP addresses are supported\&. There are several magic values\&. If it is
\fB%defaultroute\fR, and the
\fBconfig\fR
\fBsetup\fR
section\*(Aqs,
\fBinterfaces\fR
specification contains
\fB%defaultroute,\fR
\fBleft\fR
will be filled in automatically with the local address of the default\-route interface (as determined at IPsec startup time); this also overrides any value supplied for
\fBleftnexthop\fR\&. (Either
\fBleft\fR
or
\fBright\fR
may be
\fB%defaultroute\fR, but not both\&.) The value
\fB%any\fR
signifies an address to be filled in (by automatic keying) during negotiation\&. The value
\fB%opportunistic\fR
signifies that both
\fBleft\fR
and
\fBleftnexthop\fR
are to be filled in (by automatic keying) from DNS data for
\fBleft\fR\*(Aqs client\&. The values
\fB%group\fR
and
\fB%opportunisticgroup\fR
makes this a policy group conn: one that will be instantiated into a regular or opportunistic conn for each CIDR block listed in the policy group file with the same name as the conn\&.
.sp
If using IP addresses in combination with NAT, always use the actual local machine\*(Aqs (NAT\*(Aqed) IP address, and if the remote (eg right=) is NAT\*(Aqed as well, the remote\*(Aqs public (\fBnot\fR
NAT\*(Aqed) IP address\&. Note that this makes the configuration no longer symmetrical on both sides, so you cannot use an identical configuration file on both hosts\&.
.RE
.PP
\fBleftsubnet\fR
.RS 4
private subnet behind the left participant, expressed as
\fInetwork\fR\fB/\fR\fInetmask\fR
(actually, any form acceptable to
\fBipsec_ttosubnet\fR(3)); Currentlly, IPv4 and IPv6 ranges are supported\&. if omitted, essentially assumed to be
\fIleft\fR/32, signifying that the left end of the connection goes to the left participant only
.sp
It supports two magic shorthands
\fIvhost:\fR
and
\fIvnet:\fR, which can list subnets in the same syntax as
\fIvirtual_private\fR\&. The value
\fI%priv\fR
expands to the networks specified in
\fIvirtual_private\fR\&. The value
\fI%no\fR
means no subnet\&. A common use for allowing roadwarrios to come in on public IPs or via accepted NATed networks from RFC1918 is to use
\fIleftsubnet=vhost:%no,%priv\fR\&. The
\fIvnet:\fR
option can be used to allow RFC1918 subnets without hardcoding them\&. When using vnet the connection will instantiate, allowing for multiple tunnels with different subnets\&.
.RE
.PP
\fBleftsubnets\fR
.RS 4
specify multiple private subnets behind the left participant, expressed as {
\fInetworkA\fR\fB/\fR\fInetmaskA\fR
\fInetworkB\fR\fB/\fR\fInetmaskB\fR
\fI[\&.\&.\&.]\fR
} If both leftsubnets= and rightsubnets= are defined, all combinations of subnet tunnels will be instantiated\&. You cannot use leftsubnet and leftsubnets together\&. For examples see
\fItesting/pluto/multinet\-*\fR\&.
.RE
.PP
\fBleftprotoport\fR
.RS 4
allowed protocols and ports over connection, also called Port Selectors\&. The argument is in the form
\fIprotocol\fR, which can be a number or a name that will be looked up in
\fI/etc/protocols\fR, such as
\fIleftprotoport=icmp\fR, or in the form of
\fIprotocol/port\fR, such as
\fItcp/smtp\fR\&. Ports can be defined as a number (eg\&. 25) or as a name (eg smtp) which will be looked up in
\fI/etc/services\fR\&. A special keyword
\fI%any\fR
can be used to allow all ports of a certain protocol\&. The most common use of this option is for L2TP connections to only allow l2tp packets (UDP port 1701), eg:
\fIleftprotoport=17/1701\fR\&. Some clients, notably older Windows XP and some Mac OSX clients, use a random high port as source port\&. In those cases
\fIrightprotoport=17/%any\fR
can be used to allow all UDP traffic on the connection\&. Note that this option is part of the proposal, so it cannot be arbitrarily left out if one end does not care about the traffic selection over this connection \- both peers have to agree\&. The Port Selectors show up in the output of
\fIipsec eroute\fR
and
\fIipsec auto \-\-status\fR
eg:\fI"l2tp": 193\&.110\&.157\&.131[@aivd\&.xelernace\&.com]:7/1701\&.\&.\&.%any:17/1701\fR
This option only filters outbound traffic\&. Inbound traffic selection must still be based on firewall rules activated by an updown script\&. The variablees $PLUTO_MY_PROTOCOL, $PLUTO_PEER_PROTOCOL, $PLUTO_MY_PORT, and $PLUTO_PEER_PORT are available for use in
\fIupdown\fR
scripts\&. Older workarounds for bugs involved a setting of
\fI17/0\fR
to denote
\fIany single UDP port\fR
(not UDP port 0)\&. Some clients, most notably OSX, uses a random high port, instead of port 1701 for L2TP\&.
.RE
.PP
\fBleftnexthop\fR
.RS 4
next\-hop gateway IP address for the left participant\*(Aqs connection to the public network; defaults to
\fB%direct\fR
(meaning
\fIright\fR)\&. If the value is to be overridden by the
\fBleft=%defaultroute\fR
method (see above), an explicit value must
\fInot\fR
be given\&. If that method is not being used, but
\fBleftnexthop\fR
is
\fB%defaultroute\fR, and
\fBinterfaces=%defaultroute\fR
is used in the
\fBconfig\fR
\fBsetup\fR
section, the next\-hop gateway address of the default\-route interface will be used\&. The magic value
\fB%direct\fR
signifies a value to be filled in (by automatic keying) with the peer\*(Aqs address\&. Relevant only locally, other end need not agree on it\&.
.RE
.PP
\fBleftsourceip\fR
.RS 4
the IP address for this host to use when transmitting a packet to the other side of this link\&. Relevant only locally, the other end need not agree\&. This option is used to make the gateway itself use its internal IP, which is part of the leftsubnet, to communicate to the rightsubnet or right\&. Otherwise, it will use its
\fBnearest\fR
IP address, which is its public IP address\&. This option is mostly used when defining subnet\-subnet connections, so that the gateways can talk to each other and the subnet at the other end, without the need to build additional host\-subnet, subnet\-host and host\-host tunnels\&. Both IPv4 and IPv6 addresses are supported\&.
.RE
.PP
\fBleftupdown\fR
.RS 4
what \(lqupdown\(rq script to run to adjust routing and/or firewalling when the status of the connection changes (default
\fBipsec _updown\fR)\&. May include positional parameters separated by white space (although this requires enclosing the whole string in quotes); including shell metacharacters is unwise\&. An example to enable routing when using the NETKEY stack, one can use:
.sp
leftupdown="ipsec _updown \-\-route yes"
.sp
See
\fBipsec_pluto\fR(8)
for details\&. Relevant only locally, other end need not agree on it\&.
.RE
.PP
\fBleftfirewall\fR
.RS 4
This option is obsolete and should not used anymore\&.
.RE
.PP
If one or both security gateways are doing forwarding firewalling (possibly including masquerading), and this is specified using the firewall parameters, tunnels established with IPsec are exempted from it so that packets can flow unchanged through the tunnels\&. (This means that all subnets connected in this manner must have distinct, non\-overlapping subnet address blocks\&.) This is done by the default
\fIupdown\fR
script (see
\fBipsec_pluto\fR(8))\&.
.PP
The implementation of this makes certain assumptions about firewall setup, and the availability of the
\fILinux Advanced Routing\fR
tools\&. In situations calling for more control, it may be preferable for the user to supply his own
\fIupdown\fR
script, which makes the appropriate adjustments for his system\&.
.SS "CONN PARAMETERS: AUTOMATIC KEYING"
.PP
The following parameters are relevant only to automatic keying, and are ignored in manual keying\&. Unless otherwise noted, for a connection to work, in general it is necessary for the two ends to agree exactly on the values of these parameters\&.
.PP
\fBauto\fR
.RS 4
what operation, if any, should be done automatically at IPsec startup; currently\-accepted values are
\fBadd\fR
(signifying an
\fBipsec auto\fR
\fB\-\-add\fR),
\fBroute\fR
(signifying that plus an
\fBipsec auto\fR
\fB\-\-route\fR),
\fBstart\fR
(signifying that plus an
\fBipsec auto\fR
\fB\-\-up\fR), and
\fBignore\fR
(also the default) (signifying no automatic startup operation)\&. See the
\fBconfig\fR
\fBsetup\fR
discussion below\&. Relevant only locally, other end need not agree on it (but in general, for an intended\-to\-be\-permanent connection, both ends should use
\fBauto=start\fR
to ensure that any reboot causes immediate renegotiation)\&.
.RE
.PP
\fBauthby\fR
.RS 4
how the two security gateways should authenticate each other; acceptable values are
\fBsecret\fR
for shared secrets,
\fBrsasig\fR
for RSA digital signatures (the default),
\fBsecret|rsasig\fR
for either, and
\fBnever\fR
if negotiation is never to be attempted or accepted (useful for shunt\-only conns)\&. Digital signatures are superior in every way to shared secrets\&.
.RE
.PP
\fBike\fR
.RS 4
IKE encryption/authentication algorithm to be used for the connection (phase 1 aka for IKEv1, PARENT SA for IKEv2)\&.
.sp
The format is
\fI"cipher\-integ\-prf\-modpgroup, cipher\-integ\-prf\-modpgroup, \&.\&.\&."\fR
.sp
Any left out option will be filled in with all allowed default options\&. For IKEv1, the PRF is ignored, and if it is not specified, it will be made identical to the integrity algorithm, if that is reasonable\&. The thing previous called the "hash", was an integrity check, and it is now called that\&.
.sp
Previously, the syntax used a semicolon before the modpgroup, but now both dash and semicolon are accepted\&. Multiple proposals are separated by a comma\&. If an
\fBike=\fR
line is specified, no other received proposals will be accepted\&.
.sp
Formerly there was a distinction (by using a
\fB"!"\fR
symbol) between "strict mode" or not\&. That mode has been obsoleted\&. If an
\fBike=\fR
option is specified, the mode is always strict, meaning no other received proposals will be accepted\&.
.sp
When an algorithm comes in a variety of strengths (i\&.e\&. AES\-128 and AES\-256), then the specification without the value will result in whatever is considered an appropriate strength\&. At this point, that is AES\-128, and SHA2\-256\&.
.sp
The algorithm "sha256" is an alias for "sha2_256"\&. Stronger versions can be specified as "sha2_512", for instance\&.
.sp
Some examples are
\fBike=3des\-sha1,aes\-sha1\fR,
\fBike=aes\fR,
\fBike=aes256\-sha256\-prfsha256\-modp2048\fR,
\fBike=aes\-sha1\-modp1536\fR,
\fBike=aes128\-md5\-modp2048\fR,
\fBike=3des\-md5;modp1024,aes\-sha1;modp1536\fR
or
\fBike=modp1536\fR\&.
.sp
The 1DES algorithm can not be included at all\&. Openswan does includes sensible defaults, but they change over time\&.
.sp
If openswan was compiled with USE_MODP_RFC5114 support, then Diffie\-Hellman groups 22, 23 and 24 are also implemented as per RFC\-5114\&. Instead of the modp key syntax, use the "dh" keyword, for example
\fIike=3des\-sha1;dh23\fR
.RE
.PP
\fBphase2\fR
.RS 4
Sets the type of SA that will be produced\&. Valid options are:
\fBesp\fR
for encryption (the default),
\fBah\fR
for authentication only, and
\fBah+esp\fR
for nested AH+ESP\&. Note that ESP already includes AH \- the ah+esp option is for double ah headers, and should only be used when connecting to some racoon configurations that do this\&.
.RE
.PP
\fBphase2alg\fR
.RS 4
Specifies the algorithms that will be offered/accepted for a phase2 negotiation\&. If not specified, a secure set of defaults will be used\&. Sets are separated using comma\*(Aqs\&.
.sp
The default values are the same as for ike= Note also that not all ciphers available to the kernel (eg through CryptoAPI) are necessarilly supported here\&.
.sp
The format for ESP is cipher\-integ followed by an optional PFSgroup\&. The PFSgroup may be separated by a semicolon, or a dash as with ike=
.sp
For RFC\-5114 DH groups, use the "dh" keyword, eg "aes256\-sha1;dh23"
.sp
The AH algorithms could be specified with this setting, but AH is not in well supported\&.
.sp
A special case is AES CCM, which uses the syntax of "phase2alg=aes_ccm_a\-152\-null"
.sp
A special case is phase2=sha2_256\-96 which does not mean 96 bits, but means truncating the sha2_256 hash to 96 bit\&.
.RE
.PP
\fBsha2_truncbug\fR
.RS 4
The default hash truncation for sha2_256 is 128 bits\&. Linux implemented the draft version which stated 96 bits\&. This option enables using the bad 96 bits version to interop with older linux kernels (unpatched version 2\&.6\&.33 and older) and openswan versions before 2\&.6\&.38\&. Currently the accepted values are
\fBno\fR, (the default) signifying default IETF truncation of 128 bits, or
\fByes\fR, signifying 96 bits broken Linux kernel style truncation\&.
.RE
.PP
\fBesp\fR
.RS 4
This option is obsolete\&. Please use
\fBphase2alg\fR
instead\&.
.RE
.PP
\fBah\fR
.RS 4
AH authentication algorithm to be used for the connection, e\&.g here\&.
\fBhmac\-md5\fR
The options must be suitable as a value of
\fBipsec_spi\fR(8)\*(Aqs
\fB\-\-ah\fR
option\&. The default is not to use AH\&. If for some (invalid) reason you still think you need AH, please use esp with the null encryption cipher instead\&. Note also that not all ciphers available to the kernel (eg through CryptoAPI) are necessarilly supported here\&.
.RE
.PP
\fBikev2\fR
.RS 4
IKEv2 (RFC4309) settings to be used\&. Currently the accepted values are
\fBpermit\fR, (the default) signifying no IKEv2 should be transmitted, but will be accepted if the other ends initiates to us with IKEv2;
\fBnever\fR
or
\fBno\fR
signifying no IKEv2 negotiation should be transmitted or accepted;
\fBpropose\fR
or
\fByes\fR
signifying that we permit IKEv2, and also use it as the default to initiate;
\fBinsist\fR, signifying we only accept and receive IKEv2 \- IKEv1 negotiations will be rejected\&.
.sp
If the ikev2= setting is set to
\fBpermit\fR
or
\fBpropose\fR, Openswan will try and detect a "bid down" attack from IKEv2 to IKEv1\&. Since there is no standard for transmitting the IKEv2 capability with IKEv1, Openswan uses a special Vendor ID "CAN\-IKEv2"\&. If a fall back from IKEv2 to IKEv1 was detected, and the IKEv1 negotiation contains Vendor ID "CAN\-IKEv2", Openswan will immediately attempt and IKEv2 rekey and refuse to use the IKEv1 connection\&. With an ikev2= setting of
\fBinsist\fR, no IKEv1 negotiation is allowed, and no bid down attack is possible\&.
.RE
.PP
\fBnarrowing\fR
.RS 4
IKEv2 (RFC5996) Section 2\&.9 Traffic Selector narrowing options\&. Currently the accepted values are
\fBno\fR, (the default) signifying no narrowing will be proposed or accepted, or
\fByes\fR, signifying IKEv2 negotiation may allow establishing an IPsec connection with narrowed down traffic selectors\&. This option is ignored for IKEv1\&.
.sp
There are security implications in allowing narrowing down the proposal\&. For one, what should be done with packets that we hoped to tunnel, but cannot\&. Should these be dropped or send in the clear? Second, this could cause thousands of narrowed down Child SA\*(Aqs to be created if the conn has a broad policy (eg 0/0 to 0/0)\&. One possible good use case scenario is that a remote end (that you fully trust) allows you to define a 0/0 to them, while adjusting what traffic you route via them, and what traffic remains outside the tunnel\&. However, it is always preferred to setup the exact tunnel policy you want, as this will be much clearer to the user\&.
.RE
.PP
\fBsareftrack\fR
.RS 4
Set the method of tracking reply packets with SArefs when using an SAref compatible stack\&. Currently only the
\fImast\fR
stack supports this\&. Acceptable values are
\fByes\fR
(the default),
\fBno\fR
or
\fBconntrack\fR\&. This option is ignored when SArefs are not supported\&. This option is passed as PLUTO_SAREF_TRACKING to the
\fIupdown\fR
script which makes the actual decisions whether to perform any iptables/ip_conntrack manipulation\&. A value of yes means that an IPSEC mangle table will be created\&. This table will be used to match reply packets\&. A value of conntrack means that additionally, subsequent packets using this connection will be marked as well, reducing the lookups needed to find the proper SAref by using the ip_conntrack state\&. A value of no means no IPSEC mangle table is created, and SAref tracking is left to a third\-party (kernel) module\&. In case of a third party module, the SArefs can be relayed using the HAVE_STATSD deamon\&.
.RE
.PP
\fBleftid\fR
.RS 4
how the left participant should be identified for authentication; defaults to
\fBleft\fR\&. Can be an IP address (in any
\fBipsec_ttoaddr\fR(3)
syntax) or a fully\-qualified domain name preceded by
\fB@\fR
(which is used as a literal string and not resolved)\&. The magic value
\fB%fromcert\fR
causes the ID to be set to a DN taken from a certificate that is loaded\&. Prior to 2\&.5\&.16, this was the default if a certificate was specified\&. The magic value
\fB%none\fR
sets the ID to no ID\&. This is included for completeness, as the ID may have been set in the default conn, and one wishes for it to default instead of being explicitly set\&. The magic value
\fB%myid\fR
stands for the current setting of
\fImyid\fR\&. This is set in
\fBconfig setup\fR
or by
\fBipsec_whack\fR(8)), or, if not set, it is the IP address in
\fB%defaultroute\fR
(if that is supported by a TXT record in its reverse domain), or otherwise it is the system\*(Aqs hostname (if that is supported by a TXT record in its forward domain), or otherwise it is undefined\&.
.RE
.PP
\fBleftrsasigkey\fR
.RS 4
the left participant\*(Aqs public key for RSA signature authentication, in RFC 2537 format using
\fBipsec_ttodata\fR(3)
encoding\&. The magic value
\fB%none\fR
means the same as not specifying a value (useful to override a default)\&. The value
\fB%dnsondemand\fR
(the default) means the key is to be fetched from DNS at the time it is needed\&. The value
\fB%dnsonload\fR
means the key is to be fetched from DNS at the time the connection description is read from
\fIipsec\&.conf\fR; currently this will be treated as
\fB%none\fR
if
\fBright=%any\fR
or
\fBright=%opportunistic\fR\&. The value
\fB%dns\fR
is currently treated as
\fB%dnsonload\fR
but will change to
\fB%dnsondemand\fR
in the future\&. The identity used for the left participant must be a specific host, not
\fB%any\fR
or another magic value\&. The value
\fB%cert\fR
will load the information required from a certificate defined in
\fB%leftcert\fR
and automatically define leftid for you\&.
\fBCaution:\fR
if two connection descriptions specify different public keys for the same
\fBleftid\fR, confusion and madness will ensue\&.
.RE
.PP
\fBleftrsasigkey2\fR
.RS 4
if present, a second public key\&. Either key can authenticate the signature, allowing for key rollover\&.
.RE
.PP
\fBleftcert\fR
.RS 4
If you are using
\fBleftrsasigkey=%cert\fR
this defines the certificate you would like to use\&. It should point to a X\&.509 encoded certificate file\&. If you do not specify a full pathname, by default it will look in /etc/ipsec\&.d/certs\&. If openswan has been compiled with
\fBUSE_LIBNSS=true\fR, then openswan will also check the NSS database for RSA keys\&. These can be software or hardware\&.
.RE
.PP
\fBleftca\fR
.RS 4
specifies the authorized Certificate Authority (CA) that signed the certificate of the peer\&. The CA is specified by Distinguished Name (DN)\&. If undefined, it defaults to the CA that signed the certificate specified in
\fBleftcert\fR\&. The special
\fBrightca=%same\fR
is implied when not specifying a
\fBrightca\fR
and means that only peers with certificates signed by the same CA as the leftca will be allowed\&. This option is only useful in complex multi CA certificate situations\&. When using a single CA, it can be safely omitted for both left and right\&.
.RE
.PP
\fBleftsendcert\fR
.RS 4
This option configures when Openswan will send X\&.509 certificates to the remote host\&. Acceptable values are
\fBalways\fR
(signifying that we should always send a certificate),
\fBifasked\fR
(signifying that we should send a certificate if the remote end asks for it), and
\fBnever\fR
(signifying that we will never send a X\&.509 certificate)\&. The default for this option is
\fBifasked\fR
which may break compatibility with other vendor\*(Aqs IPSec implementations, such as Cisco and SafeNet\&. If you find that you are getting errors about no ID/Key found, you likely need to set this to
\fBalways\fR\&. This per\-conn option replaces the obsolete global
\fBnocrsend\fR
option\&.
.RE
.PP
\fBleftxauthserver\fR
.RS 4
Left is an XAUTH server\&. This can use PAM for authentication or md5 passwords in
\fI/etc/ipsec\&.d/passwd\fR\&. These are additional credentials to verify the user identity, and should not be confused with the XAUTH
\fBgroup secret\fR, which is just a regular PSK defined in
\fIipsec\&.secrets\fR\&. The other side of the connection should be configured as
\fBrightxauthclient\fR\&. XAUTH connections cannot rekey, so
\fBrekey=no\fR
should be specified in this conn\&. For further details on how to compile and use XAUTH, see README\&.XAUTH\&. Acceptable values are
\fByes\fR
or
\fBno\fR
(the default)\&.
.RE
.PP
\fBleftxauthclient\fR
.RS 4
Left is an XAUTH client\&. The xauth connection will have to be started interactively and cannot be configured using
\fBauto=start\fR\&. Instead, it has to be started from the commandline using
\fIipsec auto \-\-up connname\fR\&. You will then be prompted for the username and password\&. To setup an XAUTH connection non\-interactively, which defeats the whole purpose of XAUTH, but is regularly requested by users, it is possible to use a whack command \-
\fIipsec whack \-\-name baduser \-\-ipsecgroup\-xauth \-\-xauthname badusername \-\-xauthpass password \-\-initiate\fR
The other side of the connection should be configured as
\fBrightxauthserver\fR\&. Acceptable values are
\fByes\fR
or
\fBno\fR
(the default)\&.
.RE
.PP
\fBleftxauthusername\fR
.RS 4
The XAUTH username associated with this XAUTH connection\&. The XAUTH password can be configured in the
\fIipsec\&.secrets\fR
file\&.
.RE
.PP
\fBleftmodecfgserver\fR
.RS 4
Left is a Mode Config server\&. It can push network configuration to the client\&. Acceptable values are
\fByes\fR
or
\fBno\fR
(the default)\&.
.RE
.PP
\fBleftmodecfgclient\fR
.RS 4
Left is a Mode Config client\&. It can receive network configuration from the server\&. Acceptable values are
\fByes\fR
or
\fBno\fR
(the default)\&.
.RE
.PP
\fBmodecfgpull\fR
.RS 4
Pull the Mode Config network information from the server\&. Acceptable values are
\fByes\fR
or
\fBno\fR
(the default)\&.
.RE
.PP
\fBmodecfgdns1\fR, \fBmodecfgdns2\fR, \fBmodecfgwins1\fR, \fBmodecfgwins2\fR
.RS 4
Specify the IP address for DNS or WINS servers for the client to use\&.
.RE
.PP
\fBremote_peer_type\fR
.RS 4
Set the remote peer type\&. This can enable additional processing during the IKE negotiation\&. Acceptable values are
\fBcisco\fR
or
\fBietf\fR
(the default)\&. When set to cisco, support for Cisco IPsec gateway redirection and Cisco obtained DNS and domainname are enabled\&. This includes automatically updating (and restoring) /etc/resolv\&.conf\&. These options require that XAUTH is also enabled on this connection\&.
.RE
.PP
\fBnm_configured\fR
.RS 4
Mark this connection as controlled by Network Manager\&. Acceptable values are
\fByes\fR
or
\fBno\fR
(the default)\&. Currently, setting this to yes will cause openswan to skip reconfiguring resolv\&.conf when used with XAUTH and ModeConfig\&.
.RE
.PP
\fBforceencaps\fR
.RS 4
In some cases, for example when ESP packets are filtered or when a broken IPsec peer does not properly recognise NAT, it can be useful to force RFC\-3948 encapsulation\&.
\fBforceencaps=yes\fR
forces the NAT detection code to lie and tell the remote peer that RFC\-3948 encapsulation (ESP in UDP port 4500 packets) is required\&. For this option to have any effect, the setup section option
\fBnat_traversal=yes\fR
needs to be set\&. Acceptable values are
\fByes\fR
or
\fBno\fR
(the default)\&.
.RE
.PP
\fBoverlapip\fR
.RS 4
a boolean (yes/no) that determines, when *subnet=vhost: is used, if the virtual IP claimed by this states created from this connection can with states created from other connections\&.
.sp
Note that connection instances created by the Opportunistic Encryption or PKIX (x\&.509) instantiation system are distinct internally\&. They will inherit this policy bit\&.
.sp
The default is no\&.
.sp
This feature is only available with kernel drivers that support SAs to overlapping conns\&. At present only the (klips)mast protocol stack supports this feature\&.
.RE
.PP
\fBdpddelay\fR
.RS 4
Set the delay (in seconds) between Dead Peer Detection (RFC 3706) keepalives (R_U_THERE, R_U_THERE_ACK) that are sent for this connection (default
30
seconds)\&. If dpddelay is set, dpdtimeout also needs to be set\&.
.RE
.PP
\fBdpdtimeout\fR
.RS 4
Set the length of time (in seconds) we will idle without hearing either an R_U_THERE poll from our peer, or an R_U_THERE_ACK reply\&. After this period has elapsed with no response and no traffic, we will declare the peer dead, and remove the SA (default
120
seconds)\&. If dpdtimeout is set, dpdaction also needs to be set\&.
.RE
.PP
\fBdpdaction\fR
.RS 4
When a DPD enabled peer is declared dead, what action should be taken\&.
\fBhold\fR
(default) means the eroute will be put into %hold status, while
\fBclear\fR
means the eroute and SA will both be cleared\&.
\fBrestart\fR
means the the SA will immediately be renegotiated, and
\fBrestart_by_peer\fR
means that
\fIALL\fR
SA\*(Aqs to the dead peer will renegotiated\&.
.sp
\fIdpdaction=clear\fR
is really only useful on the server of a Road Warrior config\&.
.RE
.PP
\fBpfs\fR
.RS 4
whether Perfect Forward Secrecy of keys is desired on the connection\*(Aqs keying channel (with PFS, penetration of the key\-exchange protocol does not compromise keys negotiated earlier); Since there is no reason to ever refuse PFS, Openswan will allow a connection defined with
\fBpfs=no\fR
to use PFS anyway\&. Acceptable values are
\fByes\fR
(the default) and
\fBno\fR\&.
.RE
.PP
\fBpfsgroup\fR
.RS 4
This option is obsoleted, please use phase2alg if you need the pfs to be different from phase1 (the default) using: phase2alg=aes128\-md5;modp1024
.RE
.PP
\fBaggrmode\fR
.RS 4
Use Aggressive Mode instead of Main Mode\&. Aggressive Mode is less secure, and vulnerable to Denial Of Service attacks\&. It is also vulnerable to brute force attacks with software such as
\fBikecrack\fR\&. It should not be used, and it should especially not be used with XAUTH and group secrets (PSK)\&. If the remote system administrator insists on staying irresponsible, enable this option\&.
.sp
Aggressive Mode is further limited to only proposals with one DH group as there is no room to negotiate the DH group\&. Therefor it is mandatory for Aggressive Mode connections that both
\fBike=\fR
and
\fBphase2alg=\fR
options are specified with only fully specified proposal using one DH group\&. Acceptable values are
\fByes\fR
or
\fBno\fR
(the default)\&.
.sp
The ISAKMP SA is created in exchange 1 in aggressive mode\&. Openswan has to send the exponent during that exchange, so it has to know what DH group to use before starting\&. This is why you can not have multiple DH groups in aggressive mode\&. In IKEv2, which uses a similar method to IKEv1 Aggressive Mode, there is a message to convey the DH group is wrong, and so an IKEv2 connection can actually recover from picking the wrong DH group by restarting its negotiation\&.
.RE
.PP
\fBsalifetime\fR
.RS 4
how long a particular instance of a connection (a set of encryption/authentication keys for user packets) should last, from successful negotiation to expiry; acceptable values are an integer optionally followed by
\fBs\fR
(a time in seconds) or a decimal number followed by
\fBm\fR,
\fBh\fR, or
\fBd\fR
(a time in minutes, hours, or days respectively) (default
\fB8h\fR, maximum
\fB24h\fR)\&. Normally, the connection is renegotiated (via the keying channel) before it expires\&. The two ends need not exactly agree on
\fBsalifetime\fR, although if they do not, there will be some clutter of superseded connections on the end which thinks the lifetime is longer\&.
.sp
The keywords "keylife" and "lifetime" are aliases for "salifetime\&."
.RE
.PP
\fBrekey\fR
.RS 4
whether a connection should be renegotiated when it is about to expire; acceptable values are
\fByes\fR
(the default) and
\fBno\fR\&. The two ends need not agree, but while a value of
\fBno\fR
prevents Pluto from requesting renegotiation, it does not prevent responding to renegotiation requested from the other end, so
\fBno\fR
will be largely ineffective unless both ends agree on it\&.
.RE
.PP
\fBrekeymargin\fR
.RS 4
how long before connection expiry or keying\-channel expiry should attempts to negotiate a replacement begin; acceptable values as for
\fBsalifetime\fR
(default
\fB9m\fR)\&. Relevant only locally, other end need not agree on it\&.
.RE
.PP
\fBrekeyfuzz\fR
.RS 4
maximum percentage by which
\fBrekeymargin\fR
should be randomly increased to randomize rekeying intervals (important for hosts with many connections); acceptable values are an integer, which may exceed 100, followed by a `%\*(Aq (default set by
\fBipsec_pluto\fR(8), currently
\fB100%\fR)\&. The value of
\fBrekeymargin\fR, after this random increase, must not exceed
\fBsalifetime\fR\&. The value
\fB0%\fR
will suppress time randomization\&. Relevant only locally, other end need not agree on it\&.
.RE
.PP
\fBkeyingtries\fR
.RS 4
how many attempts (a whole number or
\fB%forever\fR) should be made to negotiate a connection, or a replacement for one, before giving up (default
\fB%forever\fR)\&. The value
\fB%forever\fR
means \(lqnever give up\(rq (obsolete: this can be written
0)\&. Relevant only locally, other end need not agree on it\&.
.RE
.PP
\fBikelifetime\fR
.RS 4
how long the keying channel of a connection (buzzphrase: \(lqISAKMP SA\(rq) should last before being renegotiated; acceptable values as for
\fBkeylife\fR
(default set by
\fBipsec_pluto\fR(8), currently
\fB1h\fR, maximum
\fB24h\fR)\&. The two\-ends\-disagree case is similar to that of
\fBkeylife\fR\&.
.RE
.PP
\fBcompress\fR
.RS 4
whether IPComp compression of content is proposed on the connection (link\-level compression does not work on encrypted data, so to be effective, compression must be done
\fIbefore\fR
encryption); acceptable values are
\fByes\fR
and
\fBno\fR
(the default)\&. The two ends need not agree\&. A value of
\fByes\fR
causes IPsec to propose both compressed and uncompressed, and prefer compressed\&. A value of
\fBno\fR
prevents IPsec from proposing compression; a proposal to compress will still be accepted\&.
.RE
.PP
\fBmetric\fR
.RS 4
Set the metric for the routes to the ipsecX or mastX interface\&. This makes it possible to do host failover from another interface to ipsec using route management\&. This value is passed to the _updown scripts as PLUTO_METRIC\&. This option is only available with KLIPS or MAST on Linux\&. Acceptable values are positive numbers, with the default being
\fB1\fR\&.
.RE
.PP
\fBmtu\fR
.RS 4
Set the mtu for the route(s) to the remote endpoint and/or subnets\&. This is sometimes required when the overhead of the IPsec encapsultion would cause the packet the become too big for a router on the path\&. Since IPsec cannot trust any unauthenticated ICMP messages, PATH MTU discovery does not work\&. This can also be needed when using "6to4" IPV6 deployments, which adds another header on the packet size\&. Acceptable values are positive numbers\&. There is no default\&.
.RE
.PP
\fBdisablearrivalcheck\fR
.RS 4
whether KLIPS\*(Aqs normal tunnel\-exit check (that a packet emerging from a tunnel has plausible addresses in its header) should be disabled; acceptable values are
\fByes\fR
and
\fBno\fR
(the default)\&. Tunnel\-exit checks improve security and do not break any normal configuration\&. Relevant only locally, other end need not agree on it\&.
.RE
.PP
\fBfailureshunt\fR
.RS 4
what to do with packets when negotiation fails\&. The default is
\fBnone\fR: no shunt;
\fBpassthrough\fR,
\fBdrop\fR, and
\fBreject\fR
have the obvious meanings\&.
.RE
.SS "CONN PARAMETERS: MANUAL KEYING"
.PP
This command was obsoleted around the same time that Al Gore invented the internet\&. ipsec manual was used in the jurassic period to load static keys into the kernel\&. There are no rational reasons to use this, and it is not supported anymore\&. If you need to create static SAs, then you can use
\fBipsec spi\fR
and
\fBipsec eroute\fR
when using KLIPS or
\fBip xfrm \fR
or
\fBsetkey\fR
when using NETKEY\&.
.PP
No rational person uses static keys\&. They are not easier to use\&. REPEAT: they are not easier to use\&.
.SH "CONFIG SECTIONS"
.PP
At present, the only
\fBconfig\fR
section known to the IPsec software is the one named
\fBsetup\fR, which contains information used when the software is being started (see
\fBipsec_setup\fR(8))\&. Here\*(Aqs an example:
.sp
.if n \{\
.RS 4
.\}
.nf

\fB
config setup
	interfaces="ipsec0=eth1 ipsec1=ppp0"
	klipsdebug=none
	plutodebug=control
	protostack=auto
	manualstart=
\fR
.fi
.if n \{\
.RE
.\}
.PP
Parameters are optional unless marked \(lq(required)\(rq\&.
.PP
The currently\-accepted
\fIparameter\fR
names in a
\fBconfig\fR
\fBsetup\fR
section are:
.PP
\fBmyid\fR
.RS 4
the identity to be used for
\fB%myid\fR\&.
\fB%myid\fR
is used in the implicit policy group conns and can be used as an identity in explicit conns\&. If unspecified,
\fB%myid\fR
is set to the IP address in
\fB%defaultroute\fR
(if that is supported by a TXT record in its reverse domain), or otherwise the system\*(Aqs hostname (if that is supported by a TXT record in its forward domain), or otherwise it is undefined\&. An explicit value generally starts with ``\fB@\fR\*(Aq\*(Aq\&.
.RE
.PP
\fBprotostack\fR
.RS 4
decide which protocol stack is going to be used\&. Valid values are "auto", "klips", "netkey" and "mast"\&. The "mast" stack is a variation for the klips stack\&.
.RE
.PP
\fBinterfaces\fR
.RS 4
virtual and physical interfaces for IPsec to use: a single
\fIvirtual\fR\fB=\fR\fIphysical\fR
pair, a (quoted!) list of pairs separated by white space, or
\fB%none\fR\&. One of the pairs may be written as
\fB%defaultroute\fR, which means: find the interface
\fId\fR
that the default route points to, and then act as if the value was ``\fBipsec0=\fR\fId\fR\*(Aq\*(Aq\&.
\fB%defaultroute\fR
is the default;
\fB%none\fR
must be used to denote no interfaces, or when using the NETKEY stack\&. If
\fB%defaultroute\fR
is used (implicitly or explicitly) information about the default route and its interface is noted for use by
\fBipsec_manual\fR(8)
and
\fBipsec_auto\fR(8)\&.)
.RE
.PP
\fBlisten\fR
.RS 4
IP address to listen on (default depends on
\fBinterfaces=\fR
setting)\&. Currently only accepts one IP address\&.
.RE
.PP
\fBnat_traversal\fR
.RS 4
whether to accept/offer to support NAT (NAPT, also known as "IP Masqurade") workaround for IPsec\&. Acceptable values are:
\fByes\fR
and
\fBno\fR
(the default)\&. This parameter may eventually become per\-connection\&.
.RE
.PP
\fBdisable_port_floating\fR
.RS 4
whether to enable the newer NAT\-T standards for port floating\&. Acceptable values are
\fBno\fR
(the default) and
\fByes\fR
\&.
.RE
.PP
\fBforce_keepalive\fR
.RS 4
whether to force sending NAT\-T keep\-alives to support NAT which are send to prevent the NAT router from closing its port when there is not enough traffic on the IPsec connection\&. Acceptable values are:
\fByes\fR
and
\fBno\fR
(the default)\&. This parameter may eventually become per\-connection\&.
.RE
.PP
\fBkeep_alive\fR
.RS 4
The delay (in seconds) for NAT\-T keep\-alive packets, if these are enabled using
\fBforce_keepalive\fR
This parameter may eventually become per\-connection\&.
.RE
.PP
\fBvirtual_private\fR
.RS 4
contains the networks that are allowed as subnet= for the remote clients when using the
\fBvhost:\fR
or
\fBvnet:\fR
keywords in the
\fBsubnet=\fR
parameters\&. In other words, the address ranges that may live behind a NAT router through which a client connects\&. This value is usually set to all the RFC\-1918 address space, excluding the space used in the local subnet behind the NAT (An IP address cannot live at two places at once)\&. IPv4 address ranges are denoted as
\fI%v4:a\&.b\&.c\&.d/mm\fR
and IPv6 is denoted as
\fI%v6:aaaa::bbbb:cccc:dddd:eeee/mm\fR\&. One can exclude subnets by using the
\fB!\fR\&. For example, if the VPN server is giving access to 192\&.168\&.1\&.0/24, this option should be set to:
\fIvirtual_private=%v4:10\&.0\&.0\&.0/8,%v4:192\&.168\&.0\&.0/16,%v4:172\&.16\&.0\&.0/12,%v4:!192\&.168\&.1\&.0/24\fR\&. This parameter is only needed on the server side and not on the client side that resides behind the NAT router, as the client will just use its IP address for the inner IP setting\&. This parameter may eventually become per\-connection\&. See also
\fBleftsubnet=\fR
.sp
Note: It seems that T\-Mobile in the US and Rogers/Fido in Canada have started using 25\&.0\&.0\&.0/8 as their pre\-NAT range\&. This range technically belongs to the Defence Interoperable Network Services Authority (DINSA), an agency of the Ministry of Defence of the United Kingdom\&. The network range seems to not have been announced for decades, which is probably why these organisasions "borrowed" this range\&. To support roadwarriors on these 3G networks, you might have to add it to the virtual_private= line\&.
.RE
.PP
\fBoe\fR
.RS 4
a boolean (yes/no) that determines if Opportunistic Encryption will be enabled\&. Opportunistic Encryption is the term to describe using IPsec tunnels without prearrangement\&. It uses IPSECKEY or TXT records to announce public RSA keys for certain IP\*(Aqs or identities\&.
.sp
For a complete description see /doc/draft\-richardson\-ipsec\-opportunistic\&.txt, doc/opportunism\-spec\&.txt and doc/opportunism\&.howto\&. See also the IETF BTNS working group and RFC4025\&.
.sp
The default is no\&.
.sp
This feature is only available with kernel drivers that support the caching of packets (%hold eroutes or equivalent) that allows us to respond to a packet from an unknown IP address\&. At present only the (klips)mast protocol stack supports this feature\&.
.RE
.PP
\fBnhelpers\fR
.RS 4
how many
\fIpluto helpers\fR
are started to help with cryptographic operations\&. Pluto will start
\fI(n\-1)\fR
of them, where
\fIn\fR
is the number of CPU\*(Aqs you have (including hypherthreaded CPU\*(Aqs)\&. A value of 0 forces pluto to do all operations in the main process\&. A value of \-1 tells pluto to perform the above calculation\&. Any other value forces the number to that amount\&.
.RE
.PP
\fBcrlcheckinterval\fR
.RS 4
interval, specified in seconds, after which pluto will verify loaded X\&.509 CRL\*(Aqs for expiration\&. If any of the CRL\*(Aqs is expired, or if they previously failed to get updated, a new attempt at updating the CRL is made\&. The first attempt to update a CRL is started at two times the crlcheckinterval\&. If set to
\fB0\fR, which is also the default value if this option is not specified, CRL updating is disabled\&.
.RE
.PP
\fBstrictcrlpolicy\fR
.RS 4
if not set, pluto is tolerant about missing or expired X\&.509 Certificate Revocation Lists (CRL\*(Aqs), and will allow peer certificates as long as they do not appear on an expired CRL\&. When this option is enabled, all connections with an expired or missing CRL will be denied\&. Active connections will be terminated at rekey time\&. This setup is more secure, but also dangerous\&. If the CRL is fetched through an IPsec tunnel with a CRL that expired, the entire VPN server will be dead in the water until a new CRL is manually transferred to the machine (if it allows non\-IPsec connections)\&. Acceptable values are
\fByes\fR
or
\fBno\fR
(the default)\&.
.RE
.PP
\fBforwardcontrol\fR
.RS 4
This option is obsolete and ignored\&. Please use
\fBnet\&.ipv4\&.ip_forward\ \&=\ \&0\fR
in
/etc/sysctl\&.conf
instead to control the ip forwarding behaviour\&.
.RE
.PP
\fBrp_filter\fR
.RS 4
This option is obsolete and ignored\&. Please use the
\fBnet\&.ipv4\&.conf/[iface]/rp_filter\ \&=\ \&0\fR
options in
/etc/sysctl\&.conf
instead\&. This option is badly documented; it must be
0
in many cases for ipsec to function\&.
.RE
.PP
\fBsyslog\fR
.RS 4
the
\fBsyslog\fR(2)
\(lqfacility\(rq name and priority to use for startup/shutdown log messages, default
\fBdaemon\&.error\fR\&.
.RE
.PP
\fBklipsdebug\fR
.RS 4
how much KLIPS debugging output should be logged\&. An empty value, or the magic value
\fBnone\fR, means no debugging output (the default)\&. The magic value
\fBall\fR
means full output\&. Otherwise only the specified types of output (a quoted list, names separated by white space) are enabled; for details on available debugging types, see
\fBipsec_klipsdebug\fR(8)\&. This KLIPS option has no effect on NETKEY, Windows or BSD stacks\&.
.RE
.PP
\fBplutodebug\fR
.RS 4
how much Pluto debugging output should be logged\&. An empty value, or the magic value
\fBnone\fR, means no debugging output (the default)\&. The magic value
\fBall\fR
means full output\&. Otherwise only the specified types of output (a quoted list, names without the
\fB\-\-debug\-\fR
prefix, separated by white space) are enabled; for details on available debugging types, see
\fBipsec_pluto\fR(8)\&.
.RE
.PP
\fBuniqueids\fR
.RS 4
whether a particular participant ID should be kept unique, with any new (automatically keyed) connection using an ID from a different IP address deemed to replace all old ones using that ID\&. Acceptable values are
\fByes\fR
(the default) and
\fBno\fR\&. Participant IDs normally
\fIare\fR
unique, so a new (automatically\-keyed) connection using the same ID is almost invariably intended to replace an old one\&.
.RE
.PP
\fBplutorestartoncrash\fR
.RS 4
prevent pluto from restarting after it crashed\&. This option should only be used when debugging a crasher\&. It will prevent overwriting a core file on a new start, or a cascade of core files\&. This option is also required if used with plutostderrlog= to avoid clearing the logs of the crasher\&. Values can be yes (the default) or no\&.
.RE
.PP
\fBplutoopts\fR
.RS 4
additional options to pass to pluto upon startup\&. See
\fBipsec_pluto\fR(8)\&.
.RE
.PP
\fBplutostderrlog\fR
.RS 4
do not use syslog, but rather log to stderr, and direct stderr to the argument file\&.
.RE
.PP
\fBplutostderrlogtime\fR
.RS 4
Whether pluto logs messages with the current timestamp as prefix\&. This might be desired when using
\fBplutostderrlog=\fR, which per default does not log timestamps, as the output is used for the test suite and would have to be filtered out\&. Values are
\fBno\fR(the default) or
\fByes\fR
\&.
.RE
.PP
\fBpluto\fR
.RS 4
whether to start Pluto or not; Values are
\fByes\fR
(the default) or
\fBno\fR
(useful only in special circumstances)\&.
.RE
.PP
\fBplutowait\fR
.RS 4
should Pluto wait for each negotiation attempt that is part of startup to finish before proceeding with the next? Values are
\fByes\fR
or
\fBno\fR
(the default)\&.
.RE
.PP
\fBprepluto\fR
.RS 4
shell command to run before starting Pluto (e\&.g\&., to decrypt an encrypted copy of the
\fIipsec\&.secrets\fR
file)\&. It\*(Aqs run in a very simple way; complexities like I/O redirection are best hidden within a script\&. Any output is redirected for logging, so running interactive commands is difficult unless they use
/dev/tty
or equivalent for their interaction\&. Default is none\&.
.RE
.PP
\fBpostpluto\fR
.RS 4
shell command to run after starting Pluto (e\&.g\&., to remove a decrypted copy of the
\fIipsec\&.secrets\fR
file)\&. It\*(Aqs run in a very simple way; complexities like I/O redirection are best hidden within a script\&. Any output is redirected for logging, so running interactive commands is difficult unless they use
/dev/tty
or equivalent for their interaction\&. Default is none\&.
.RE
.PP
\fBdumpdir\fR
.RS 4
in what directory should things started by
\fIsetup\fR
(notably the Pluto daemon) be allowed to dump core? The empty value (the default) means they are not allowed to\&.
.RE
.PP
\fBfragicmp\fR
.RS 4
whether a tunnel\*(Aqs need to fragment a packet should be reported back with an ICMP message, in an attempt to make the sender lower his PMTU estimate; acceptable values are
\fByes\fR
(the default) and
\fBno\fR\&. This KLIPS option has no effect on NETKEY, Windows or BSD stacks\&.
.RE
.PP
\fBhidetos\fR
.RS 4
whether a tunnel packet\*(Aqs TOS field should be set to
0
rather than copied from the user packet inside; acceptable values are
\fByes\fR
(the default) and
\fBno\fR\&. This KLIPS option has no effect on NETKEY, Windows or BSD stacks\&.
.RE
.PP
\fBoverridemtu\fR
.RS 4
value that the MTU of the ipsec\fIn\fR
interface(s) should be set to, overriding IPsec\*(Aqs (large) default\&. This parameter is needed only in special situations\&. This KLIPS option has no effect on NETKEY, Windows or BSD stacks\&.
.RE
.PP
\fBfirstmsgid\fR
.RS 4
value of the message ID used, by this host, to generate the first IKEv2 request message\&. This value is only used when the initial connection responder sends a request to the initial connection initiator, like in the case of a child SA rekey\&. The value must be either 0 (the default) or 1\&. The default value (0) is consistent with the RFCs and compatible with strongSwan, while firstmsgid=1 allows for backwards compatibility with OpenSWAN pre 2\&.6\&.52\&.
.RE
.SH "IMPLICIT CONNS"
.PP
The system automatically defines several conns to implement default policy groups\&. Each can be overridden by explicitly defining a new conn with the same name\&. If the new conn has
\fBauto=ignore\fR, the definition is suppressed\&.
.PP
Here are the automatically supplied definitions\&.
.sp
.if n \{\
.RS 4
.\}
.nf

\fB
conn clear
	type=passthrough
	authby=never
	left=%defaultroute
	right=%group
	auto=route

conn clear\-or\-private
	type=passthrough
	left=%defaultroute
	leftid=%myid
	right=%opportunisticgroup
	failureshunt=passthrough
	keyingtries=3
	ikelifetime=1h
	salifetime=1h
	rekey=no
	auto=route

conn private\-or\-clear
	type=tunnel
	left=%defaultroute
	leftid=%myid
	right=%opportunisticgroup
	failureshunt=passthrough
	keyingtries=3
	ikelifetime=1h
	salifetime=1h
	rekey=no
	auto=route

conn private
	type=tunnel
	left=%defaultroute
	leftid=%myid
	right=%opportunisticgroup
	failureshunt=drop
	keyingtries=3
	ikelifetime=1h
	salifetime=1h
	rekey=no
	auto=route

conn block
	type=reject
	authby=never
	left=%defaultroute
	right=%group
	auto=route

# default policy
conn packetdefault
	type=tunnel
	left=%defaultroute
	leftid=%myid
	left=0\&.0\&.0\&.0/0
	right=%opportunistic
	failureshunt=passthrough
	keyingtries=3
	ikelifetime=1h
	salifetime=1h
	rekey=no
	auto=route
\fR
.fi
.if n \{\
.RE
.\}
.PP
These conns are
\fInot\fR
affected by anything in
\fBconn %default\fR\&. They will only work if
\fB%defaultroute\fR
works\&. The
\fBleftid\fR
will be the interfaces IP address; this requires that reverse DNS records be set up properly\&.
.PP
The implicit conns are defined after all others\&. It is appropriate and reasonable to use
\fBalso=private\-or\-clear\fR
(for example) in any other opportunistic conn\&.
.SH "POLICY GROUP FILES"
.PP
The optional files under
/etc/ipsec\&.d/policy, including
.sp
.if n \{\
.RS 4
.\}
.nf

/etc/ipsec\&.d/policies/clear
/etc/ipsec\&.d/policies/clear\-or\-private
/etc/ipsec\&.d/policies/private\-or\-clear
/etc/ipsec\&.d/policies/private
/etc/ipsec\&.d/policies/block

.fi
.if n \{\
.RE
.\}
.PP
may contain policy group configuration information to supplement
\fIipsec\&.conf\fR\&. Their contents are not security\-sensitive\&.
.PP
These files are text files\&. Each consists of a list of CIDR blocks, one per line\&. White space followed by # followed by anything to the end of the line is a comment and is ignored, as are empty lines\&.
.PP
A connection in
ipsec\&.conf
which has
\fBright=%group\fR
or
\fBright=%opportunisticgroup\fR
is a policy group connection\&. When a policy group file of the same name is loaded, with
.PP
\ \&\ \&\ \&\ \&\ \&\fBipsec auto \-\-rereadgroups\fR
.PP
or at system start, the connection is instantiated such that each CIDR block serves as an instance\*(Aqs
\fBright\fR
value\&. The system treats the resulting instances as normal connections\&.
.PP
For example, given a suitable connection definition
\fBprivate\fR, and the file
/etc/ipsec\&.d/policy/private
with an entry 192\&.0\&.2\&.3, the system creates a connection instance
\fBprivate#192\&.0\&.2\&.3\&.\fR
This connection inherits all details from
\fBprivate\fR, except that its right client is 192\&.0\&.2\&.3\&.
.SH "DEFAULT POLICY GROUPS"
.PP
The standard Openswan install includes several policy groups which provide a way of classifying possible peers into IPsec security classes:
\fBprivate\fR
(talk encrypted only),
\fBprivate\-or\-clear\fR
(prefer encryption),
\fBclear\-or\-private\fR
(respond to requests for encryption),
\fBclear\fR
and
\fBblock\fR\&. Implicit policy groups apply to the local host only, and are implemented by the
\fBIMPLICIT CONNECTIONS\fR
described above\&.
.SH "CHOOSING A CONNECTION [THIS SECTION IS EXTREMELY OUT OF DATE"
.PP
When choosing a connection to apply to an outbound packet caught with a
\fB%trap,\fR
the system prefers the one with the most specific eroute that includes the packet\*(Aqs source and destination IP addresses\&. Source subnets are examined before destination subnets\&. For initiating, only routed connections are considered\&. For responding, unrouted but added connections are considered\&.
.PP
When choosing a connection to use to respond to a negotiation which doesn\*(Aqt match an ordinary conn, an opportunistic connection may be instantiated\&. Eventually, its instance will be /32 \-> /32, but for earlier stages of the negotiation, there will not be enough information about the client subnets to complete the instantiation\&.
.SH "FILES"
.sp
.if n \{\
.RS 4
.\}
.nf
/etc/ipsec\&.conf
/etc/ipsec\&.d/policies/clear
/etc/ipsec\&.d/policies/clear\-or\-private
/etc/ipsec\&.d/policies/private\-or\-clear
/etc/ipsec\&.d/policies/private
/etc/ipsec\&.d/policies/block
.fi
.if n \{\
.RE
.\}
.SH "SEE ALSO"
.PP
\fBipsec\fR(8),
\fBipsec_ttoaddr\fR(8),
\fBipsec_auto\fR(8),
\fBipsec_manual\fR(8),
\fBipsec_rsasigkey\fR(8)
.SH "HISTORY"
.PP
Designed for the FreeS/WAN project <\m[blue]\fBhttp://www\&.freeswan\&.org\fR\m[]> by Henry Spencer\&.
.SH "BUGS"
.PP
Before reporting new bugs, please ensure you are using the latest version of Openswan, and if not using KLIPS, please ensure you are using the latest kernel code for your IPsec stack\&.
.PP
When
\fBtype\fR
or
\fBfailureshunt\fR
is set to
\fBdrop\fR
or
\fBreject,\fR
Openswan blocks outbound packets using eroutes, but assumes inbound blocking is handled by the firewall\&. Openswan offers firewall hooks via an \(lqupdown\(rq script\&. However, the default
\fBipsec _updown\fR
provides no help in controlling a modern firewall\&.
.PP
Including attributes of the keying channel (authentication methods,
\fBikelifetime\fR, etc\&.) as an attribute of a connection, rather than of a participant pair, is dubious and incurs limitations\&.
.PP
The use of
\fB%any\fR
with the
\fIprotoport=\fR
option is ambiguous\&. Should the SA permits any port through or should the SA negotiate any single port through? The first is a basic conn with a wildcard\&. The second is a template\&. The second is the current behaviour, and it\*(Aqs wrong for quite a number of uses involving TCP\&. The keyword
\fB%one\fR
may be introduced in the future to separate these two cases\&.
.PP
\fIipsec_manual\fR
is not nearly as generous about the syntax of subnets, addresses, etc\&. as the usual Openswan user interfaces\&. Four\-component dotted\-decimal must be used for all addresses\&. It
\fIis\fR
smart enough to translate bit\-count netmasks to dotted\-decimal form\&.
.PP
It would be good to have a line\-continuation syntax, especially for the very long lines involved in RSA signature keys\&.
.PP
\fBFirst packet caching\fR
is only implemented for the KLIPS(NG) and MAST stacks\&. NETKEY returns POSIX\-breaking responses, visiable as
\fIconnect: Resource temporarily unavailable\fR
errors\&. This affects Opportunistic Encryption and DPD\&. Functionality on the BSD and Windows stacks is unknown\&.
.PP
Some state information is only available when using KLIPS, and will return errors on other IPsec stacks\&. These include
\fIipsec eroute\fR,
\fIipsec spi\fR
and
\fIipsec look\fR\&.
.PP
Multiple L2TP clients behind the same NAT router, and multiple L2TP clients behind different NAT routers using the same Virtual IP is currently only working for the KLIPSNG stack\&.
.PP
The ability to specify different identities,
\fBauthby\fR, and public keys for different automatic\-keyed connections between the same participants is misleading; this doesn\*(Aqt work dependably because the identity of the participants is not known early enough\&. This is especially awkward for the \(lqRoad Warrior\(rq case, where the remote IP address is specified as
0\&.0\&.0\&.0, and that is considered to be the \(lqparticipant\(rq for such connections\&.
.PP
In principle it might be necessary to control MTU on an interface\-by\-interface basis, rather than with the single global override that
\fBoverridemtu\fR
provides\&. This feature is planned for a future release\&.
.PP
A number of features which
\fIcould\fR
be implemented in both manual and automatic keying actually are not yet implemented for manual keying\&. This is unlikely to be fixed any time soon\&.
.PP
If conns are to be added before DNS is available,
\fBleft=\fR\fIFQDN\fR,
\fBleftnextop=\fR\fIFQDN\fR, and
\fBleftrsasigkey=%dnsonload\fR
will fail\&.
\fBipsec_pluto\fR(8)
does not actually use the public key for our side of a conn but it isn\*(Aqt generally known at a add\-time which side is ours (Road Warrior and Opportunistic conns are currently exceptions)\&.
.PP
The
\fBmyid\fR
option does not affect explicit
\fB ipsec auto \-\-add\fR
or
\fBipsec auto \-\-replace\fR
commands for implicit conns\&.
